package com.zoshine.zzg.pojo.table;

import com.zoshine.zzg.pojo.table.base.Column;
import com.zoshine.zzg.pojo.table.base.Table;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 贾俊峰
 * @time 2017/8/10 15:47
 */
public abstract class Tables {
    /**内网表列表*/
    public static final List<Table> INNER_TABLE_LIST = new ArrayList<>();
    /**外网表列表*/
    public static final List<Table> OUTER_TABLE_LIST = new ArrayList<>();
    
    private static final Table GOODS_INFO = new Table("goods_info", "商品信息", "id", null);
    private static final Table GOODS_PUBLISH_DETAIL = new Table("goods_publish_detail", "上架商品明细", "id", null);
    private static final Table GOODS_RETURN = new Table("goods_return", "缺货登记", "id", null);
    private static final Table GOODS_TYPE = new Table("goods_type", "商品类型", "id", "type_name");
    private static final Table IMPORT_EXPORT = new Table("import_export", "导入导出", "id", "type,source,target,prison_id,serial_number");
    private static final Table INVOICE = new Table("invoice", "发货单", "id", null);
    private static final Table INVOICE_DETAIL = new Table("invoice_detail", "发货单明细", "id", null);
    private static final Table MENU = new Table("menu", "菜单", "id", "menu_id");
    private static final Table ORDER_SUPPLIER = new Table("order_supplier", "供应商订单", "order_supplier_id", null);
    private static final Table ORDER_SUPPLIER_DETAIL = new Table("order_supplier_detail", "供应商订单明细", "order_supplier_detail_id", null);
    private static final Table ORGANIZATION = new Table("organization", "组织", "org_id", null);
    private static final Table POWER = new Table("power", "权限", "obj_type,obj_id,power_type,power_id", null);
    private static final Table RELATION_SUPPLIER_PRISON = new Table("relation_supplier_prison","供应商监所关联关系","supplier_id,prison_id",null);
    private static final Table ROLE = new Table("role", "角色","id", "role_name,org_id");
    private static final Table SETTLEMENT = new Table("settlement", "供应商结算", "id", null);
    private static final Table SYSTEM_PARAM = new Table("system_param", "系统参数", "id", "param_name");
    private static final Table USER_MEMBER = new Table("user_member", "用户", "user_id", "username");
    private static final Table USER_DETAIL = new Table("user_detail", "用户详情", "user_id", null);
//    private static final Table SUPPLIER_SETTLEMENT = new Table("supplier_settlement", "供应商结算", "settlement_id", null);
//    private static final Table SUPPLIER_DETAIL = new Table("supplier_detail", "供应商详情", "org_id", null);
//    private static final Table REPORT = new Table("report", "报表", "report_id", null);
    private static final Table RELEASE_SLIP_DETAIL = new Table("release_slip_detail", "发放清单详情", "id", null);
    private static final Table RELEASE_SLIP = new Table("release_slip", "发放清单", "id", null);
    private static final Table RELATION_SUPPLIER_PRISONER = new Table("relation_supplier_prisoner", "供应商订单与犯人订单关系表", null, null);
    private static final Table PRISONER_SETTLEMENT = new Table("prisoner_settlement", "犯人结算单", "settlement_id", null);
    private static final Table PRISONER_INFO = new Table("prisoner_info", "犯人信息表", "prisoner_id", null);
    private static final Table PRISONER_ACCOUNT = new Table("prisoner_account", "犯人账户表", "prisoner_id", "bank_card");
//    private static final Table ORDER_RECEIVE_DETAIL = new Table("order_receive_detail", "发货单详情", "order_receive_detail_id", null);
//    private static final Table ORDER_RECEIVE = new Table("order_receive", "收货单管理", "receive_id", null);
    private static final Table ORDER_PRISONER_DETAIL = new Table("order_prisoner_detail", "犯人点单详情", "order_prisoner_detail_id", null);
    private static final Table ORDER_PRISONER = new Table("order_prisoner", "犯人点单表", "order_prisoner_id", null);
    private static final Table GOODS_HISTORY_DETAIL = new Table("goods_history_detail", "历史商品详情", "id", null);
    private static final Table ACCOUNT = new Table("account", "账户表", "account", null);

    static {
        // 外网
        OUTER_TABLE_LIST.add(GOODS_INFO);
        OUTER_TABLE_LIST.add(GOODS_PUBLISH_DETAIL);
        OUTER_TABLE_LIST.add(GOODS_RETURN);
        OUTER_TABLE_LIST.add(GOODS_TYPE);
        OUTER_TABLE_LIST.add(IMPORT_EXPORT);
        OUTER_TABLE_LIST.add(INVOICE);
        OUTER_TABLE_LIST.add(INVOICE_DETAIL);
        OUTER_TABLE_LIST.add(MENU);
        OUTER_TABLE_LIST.add(ORDER_SUPPLIER);
        OUTER_TABLE_LIST.add(ORDER_SUPPLIER_DETAIL);
        OUTER_TABLE_LIST.add(ORGANIZATION);
        OUTER_TABLE_LIST.add(POWER);
        OUTER_TABLE_LIST.add(RELATION_SUPPLIER_PRISON);
        OUTER_TABLE_LIST.add(ROLE);
        OUTER_TABLE_LIST.add(SETTLEMENT);
        OUTER_TABLE_LIST.add(SYSTEM_PARAM);
        OUTER_TABLE_LIST.add(USER_MEMBER);

        // 内网
//        INNER_TABLE_LIST.add(ACCOUNT);
        INNER_TABLE_LIST.add(GOODS_HISTORY_DETAIL);
        INNER_TABLE_LIST.add(GOODS_PUBLISH_DETAIL);
        INNER_TABLE_LIST.add(GOODS_RETURN);
        INNER_TABLE_LIST.add(GOODS_TYPE);
        INNER_TABLE_LIST.add(IMPORT_EXPORT);
        INNER_TABLE_LIST.add(INVOICE);
        INNER_TABLE_LIST.add(INVOICE_DETAIL);
        INNER_TABLE_LIST.add(MENU);
        INNER_TABLE_LIST.add(ORDER_PRISONER);
        INNER_TABLE_LIST.add(ORDER_PRISONER_DETAIL);
        INNER_TABLE_LIST.add(ORDER_SUPPLIER);
        INNER_TABLE_LIST.add(ORDER_SUPPLIER_DETAIL);
        INNER_TABLE_LIST.add(ORGANIZATION);
        INNER_TABLE_LIST.add(POWER);
        INNER_TABLE_LIST.add(PRISONER_ACCOUNT);
        INNER_TABLE_LIST.add(PRISONER_INFO);
        INNER_TABLE_LIST.add(PRISONER_SETTLEMENT);
        INNER_TABLE_LIST.add(RELATION_SUPPLIER_PRISON);
        INNER_TABLE_LIST.add(RELATION_SUPPLIER_PRISONER);
        INNER_TABLE_LIST.add(RELEASE_SLIP);
        INNER_TABLE_LIST.add(RELEASE_SLIP_DETAIL);
        INNER_TABLE_LIST.add(ROLE);
        INNER_TABLE_LIST.add(SYSTEM_PARAM);
        INNER_TABLE_LIST.add(USER_DETAIL);
        INNER_TABLE_LIST.add(USER_MEMBER);
    }
    static {
        // 商品信息
        GOODS_INFO.addColumn(new Column("id","商品编号","NUMBER(20)","bigint(20) unsigned",false,null));
        GOODS_INFO.addColumn(new Column("goods_name","商品名称","VARCHAR2(100)","varchar(100)",false,null));
        GOODS_INFO.addColumn(new Column("goods_type","商品类型","NUMBER(20)","bigint(20) unsigned",false,null));
        GOODS_INFO.addColumn(new Column("goods_bar_code","商品条型码","VARCHAR2(20)","varchar(20)",true,null));
        GOODS_INFO.addColumn(new Column("goods_market_price","商品市场价","NUMBER(10)","int(11)",false,0));
        GOODS_INFO.addColumn(new Column("goods_sell_price","商品销售价","NUMBER(10)","int(11)",false,0));
        GOODS_INFO.addColumn(new Column("goods_settlement_price","商品结算价","NUMBER(10)","int(11)",false,0));
        GOODS_INFO.addColumn(new Column("goods_spec","商品规格","VARCHAR2(60)","varchar(60)",true,null));
        GOODS_INFO.addColumn(new Column("goods_unit","商品单位","VARCHAR2(60)","varchar(60)",true,null));
        GOODS_INFO.addColumn(new Column("goods_img","商品图片","VARCHAR2(255)","varchar(255)",true,null));
        GOODS_INFO.addColumn(new Column("goods_status","商品状态","NUMBER(4)","tinyint(4)",true,null));
        GOODS_INFO.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        GOODS_INFO.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        GOODS_INFO.addColumn(new Column("user_id","创建人","NUMBER(20)","bigint(20) unsigned",true,null));
        GOODS_INFO.addColumn(new Column("org_id","组织编号","NUMBER(20)","bigint(20) unsigned",true,null));
        GOODS_INFO.addColumn(new Column("org_name","组织名称","VARCHAR2(50)","varchar(50)",true,null));

        // 上架商品信息
//        GOODS_PUBLISH.addColumn(new Column("publish_id","上架ID","NUMBER(20)","bigint(20)",false,null));
//        GOODS_PUBLISH.addColumn(new Column("supplier_id","供应商ID","NUMBER(20)","bigint(20)",true,null));
//        GOODS_PUBLISH.addColumn(new Column("supplier_name","供应商名称","VARCHAR2(50)","varchar(50)",true,null));
//        GOODS_PUBLISH.addColumn(new Column("prisons_id","监所ID","NUMBER(20)","bigint(20)",true,null));
//        GOODS_PUBLISH.addColumn(new Column("prisons_name","监所名称","VARCHAR2(50)","varchar(50)",true,null));
//        GOODS_PUBLISH.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
//        GOODS_PUBLISH.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
//        GOODS_PUBLISH.addColumn(new Column("status","状态","NUMBER(10)","int(11)",false,null));

        // 上架商品明细
        GOODS_PUBLISH_DETAIL.addColumn(new Column("id","上架商品编号","NUMBER(20)","bigint(20) unsigned",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("publish_id","上架ID","NUMBER(20)","bigint(20)",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_id","商品编号","NUMBER(20)","bigint(20) unsigned",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_name","商品名称","VARCHAR2(100)","varchar(100)",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_type","商品类型","NUMBER(20)","bigint(20) unsigned",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_bar_code","商品条型码","VARCHAR2(20)","varchar(20)",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_market_price","商品市场价","NUMBER(10)","int(11)",false,0));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_sell_price","商品销售价","NUMBER(10)","int(11)",false,0));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_settlement_price","商品结算价","NUMBER(10)","int(11)",false,0));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_spec","商品规格","VARCHAR2(60)","varchar(60)",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_unit","商品单位","VARCHAR2(60)","varchar(60)",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_img","商品图片","VARCHAR2(255)","varchar(255)",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("goods_status","商品状态","NUMBER(4)","tinyint(4)",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("user_id","创建人","NUMBER(20)","bigint(20) unsigned",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("org_id","组织编号","NUMBER(20)","bigint(20) unsigned",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("org_name","组织名称","VARCHAR2(50)","varchar(50)",true,null));
        GOODS_PUBLISH_DETAIL.addColumn(new Column("prisons_id","监所编号","NUMBER(20)","bigint(20)",true,null));

        // 缺货登记
        GOODS_RETURN.addColumn(new Column("id","退货ID","NUMBER(20)","bigint(20)",false,null));
        GOODS_RETURN.addColumn(new Column("account_supplier","供应商账号","NUMBER(20)","bigint(20)",false,null));
        GOODS_RETURN.addColumn(new Column("account_prisons","监所账号","NUMBER(20)","bigint(20)",false,null));
        GOODS_RETURN.addColumn(new Column("prisoner_id","犯人账号","NUMBER(20)","bigint(20)",false,null));
        GOODS_RETURN.addColumn(new Column("goods_id","商品ID","NUMBER(20)","bigint(20)",false,null));
        GOODS_RETURN.addColumn(new Column("goods_count","商品数量","NUMBER(10)","int(10)",false,null));
        GOODS_RETURN.addColumn(new Column("status","退货状态","NUMBER(10)","int(1)",false,null));
        GOODS_RETURN.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        GOODS_RETURN.addColumn(new Column("update_time","修改时间","TIMESTAMP","datetime",false,null));
        GOODS_RETURN.addColumn(new Column("create_user","创建人","NUMBER(20)","bigint(20)",true,null));
        GOODS_RETURN.addColumn(new Column("invoice_id","发货单号","NUMBER(20)","bigint(20)",false,null));
        GOODS_RETURN.addColumn(new Column("goods_history_id","历史商品编号","NUMBER(20)","bigint(20)",false,null));

        // 商品类型
        GOODS_TYPE.addColumn(new Column("id","商品类型编号","NUMBER(20)","bigint(20) unsigned",false,null));
        GOODS_TYPE.addColumn(new Column("type_name","类型名称","VARCHAR2(20)","varchar(20)",false,null));
        GOODS_TYPE.addColumn(new Column("status","类型状态","NUMBER(4)","tinyint(4)",false,1));
        GOODS_TYPE.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        GOODS_TYPE.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));

        // 导入导出
        IMPORT_EXPORT.addColumn(new Column("id","编号","NUMBER(20)","bigint(20) unsigned",false,null));
        IMPORT_EXPORT.addColumn(new Column("type","操作类型（1：导出，2：导入）","NUMBER(4)","tinyint(4)",false,null));
        IMPORT_EXPORT.addColumn(new Column("source","源（1：外网，2：内网）","NUMBER(4)","tinyint(4)",false,null));
        IMPORT_EXPORT.addColumn(new Column("target","目标（1：外网，2：内网）","NUMBER(4)","tinyint(4)",false,null));
        IMPORT_EXPORT.addColumn(new Column("prison_id","监所编号","NUMBER(20)","bigint(20) unsigned",false,null));
        IMPORT_EXPORT.addColumn(new Column("serial_number","序列号","NUMBER(10)","int(10) unsigned",false,null));
        IMPORT_EXPORT.addColumn(new Column("download_url","下载地址","VARCHAR2(255)","varchar(255)",true,null));
        IMPORT_EXPORT.addColumn(new Column("create_user","创建人","NUMBER(20)","bigint(20) unsigned",false,null));
        IMPORT_EXPORT.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));

        // 发货单
        INVOICE.addColumn(new Column("id","收货ID","NUMBER(20)","bigint(20)",false,null));
        INVOICE.addColumn(new Column("account_prisons","监所账号","NUMBER(20)","bigint(20)",false,null));
        INVOICE.addColumn(new Column("account_supplier","供应商账号","NUMBER(20)","bigint(20)",false,null));
        INVOICE.addColumn(new Column("prisons_name","监所名称","VARCHAR2(50)","varchar(50)",true,null));
        INVOICE.addColumn(new Column("supplier_name","供应商名称","VARCHAR2(50)","varchar(50)",true,null));
        INVOICE.addColumn(new Column("total_count","总数量","NUMBER(10)","int(10)",false,null));
        INVOICE.addColumn(new Column("total_sell","总销售价","NUMBER(10)","int(10)",false,null));
        INVOICE.addColumn(new Column("total_settlement","总结算价","NUMBER(10)","int(10)",false,null));
        INVOICE.addColumn(new Column("status","状态","NUMBER(10)","int(1)",false,null));
        INVOICE.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        INVOICE.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        INVOICE.addColumn(new Column("create_user","创建人","VARCHAR2(50)","varchar(50)",true,null));
        INVOICE.addColumn(new Column("settlement_id","结算ID","NUMBER(20)","bigint(20)",true,null));

        // 发货单明细
        INVOICE_DETAIL.addColumn(new Column("id","发货单详情ID","NUMBER(20)","bigint(20)",false,null));
        INVOICE_DETAIL.addColumn(new Column("invoice_id","发货单ID","NUMBER(20)","bigint(20)",false,null));
        INVOICE_DETAIL.addColumn(new Column("publish_detail_id","上架商品ID","NUMBER(20)","bigint(20)",false,null));
        INVOICE_DETAIL.addColumn(new Column("count","商品数量","NUMBER(10)","int(10)",false,null));
        INVOICE_DETAIL.addColumn(new Column("room","监区","VARCHAR2(50)","varchar(50)",false,null));
        INVOICE_DETAIL.addColumn(new Column("order_supplier_detail_id","供应商订单详情ID","NUMBER(20)","bigint(20)",false,null));
        INVOICE_DETAIL.addColumn(new Column("account_prisons","监所账号","NUMBER(20)","bigint(20)",false,null));
        INVOICE_DETAIL.addColumn(new Column("account_supplier","供应商账号","NUMBER(20)","bigint(20)",false,null));

        // 菜单
        MENU.addColumn(new Column("id","主键编号","NUMBER(20)","bigint(20) unsigned",false,null));
        MENU.addColumn(new Column("menu_id","菜单编号","CHAR(6)","char(6)",false,null));
        MENU.addColumn(new Column("menu_name","菜单名称","VARCHAR2(20)","varchar(20)",false,null));
        MENU.addColumn(new Column("parent_id","父级菜单","CHAR(6)","char(6)",false,null));
        MENU.addColumn(new Column("menu_level","菜单级别","NUMBER(4)","tinyint(4)",false,null));
        MENU.addColumn(new Column("menu_icon","菜单图标","VARCHAR2(60)","varchar(60)",true,null));
        MENU.addColumn(new Column("menu_link","菜单链接","VARCHAR2(255)","varchar(255)",true,null));
        MENU.addColumn(new Column("menu_status","菜单状态","NUMBER(4)","tinyint(4)",false,0));
        MENU.addColumn(new Column("menu_sort","菜单排序","NUMBER(10)","int(10) unsigned",false,null));
        MENU.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        MENU.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));

        // 供应商订单
        ORDER_SUPPLIER.addColumn(new Column("order_supplier_id","供应商订单ID","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("account_prisons","监所账号","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("prisons_name","监所名称","VARCHAR2(50)","varchar(50)",true,null));
        ORDER_SUPPLIER.addColumn(new Column("account_supplier","供应商账号","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("supplier_name","供应商名称","VARCHAR2(50)","varchar(50)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("create_type","创建类型","NUMBER(10)","int(1)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        ORDER_SUPPLIER.addColumn(new Column("update_time","创建类型","TIMESTAMP","datetime",false,null));
        ORDER_SUPPLIER.addColumn(new Column("status","供应商订单状态","NUMBER(10)","int(1)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("total_deliver","已发货数量","NUMBER(10)","int(10)",true,null));
        ORDER_SUPPLIER.addColumn(new Column("total_count","总商品数量","NUMBER(10)","int(10)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("total_sell","总销售额","NUMBER(10)","int(10)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("total_settlement","总结算价","NUMBER(10)","int(10)",false,null));
        ORDER_SUPPLIER.addColumn(new Column("create_user","创建人","NUMBER(20)","bigint(20)",true,null));

        // 供应商订单明细
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("order_supplier_detail_id","供应商订单详情ID","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("order_supplier_id","供应商订单ID","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("goods_id","商品ID","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("deliver_count","已发数量","NUMBER(10)","int(10)",true,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("goods_count","商品数量","NUMBER(10)","int(10)",false,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("room","监区号","VARCHAR2(255)","varchar(255)",true,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("account_prisons","监所账号","NUMBER(20)","bigint(20)",false,null));
        ORDER_SUPPLIER_DETAIL.addColumn(new Column("account_supplier","供应商账号","NUMBER(20)","bigint(20)",false,null));

        // 组织
        ORGANIZATION.addColumn(new Column("org_id","组织ID","NUMBER(20)","bigint(20)",false,null));
        ORGANIZATION.addColumn(new Column("org_name","组织名称","VARCHAR2(60)","varchar(60)",false,null));
        ORGANIZATION.addColumn(new Column("org_type","组织类型","NUMBER(10)","int(1)",false,null));
        ORGANIZATION.addColumn(new Column("org_status","组织状态","NUMBER(10)","int(1)",false,null));
        ORGANIZATION.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        ORGANIZATION.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        ORGANIZATION.addColumn(new Column("balance","余额","NUMBER(10)","int(10)",false,null));
        ORGANIZATION.addColumn(new Column("bank_name","银行名称","VARCHAR2(50)","varchar(50)",false,null));
        ORGANIZATION.addColumn(new Column("bank_card","银行卡号","NUMBER(20)","bigint(20)",false,null));

        // 权限
        POWER.addColumn(new Column("obj_type","权限对象（1：角色，2：用户）","NUMBER(4)","tinyint(4)",false,null));
        POWER.addColumn(new Column("obj_id","对象编号","NUMBER(20)","bigint(20)",false,null));
        POWER.addColumn(new Column("power_type","权限类型（1：菜单权限）","NUMBER(4)","tinyint(4)",false,null));
        POWER.addColumn(new Column("power_id","权限编号","NUMBER(20)","bigint(20)",false,null));
        POWER.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));

        // 供应商监所关联关系
        RELATION_SUPPLIER_PRISON.addColumn(new Column("supplier_id","供应商编号","NUMBER(20)","bigint(20) unsigned",false,null));
        RELATION_SUPPLIER_PRISON.addColumn(new Column("prison_id","监所编号","NUMBER(20)","bigint(20) unsigned",false,null));
        RELATION_SUPPLIER_PRISON.addColumn(new Column("status","关系状态","NUMBER(4)","tinyint(4)",false,0));
        RELATION_SUPPLIER_PRISON.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));

        // 角色
        ROLE.addColumn(new Column("id","角色编号","NUMBER(20)","bigint(20) unsigned",false,null));
        ROLE.addColumn(new Column("role_name","角色名","VARCHAR2(20)","varchar(20)",false,null));
        ROLE.addColumn(new Column("role_status","角色状态","NUMBER(4)","tinyint(4)",false,null));
        ROLE.addColumn(new Column("org_id","所属组织","NUMBER(20)","bigint(20) unsigned",false,null));
        ROLE.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        ROLE.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));

        // 供应商结算
        SETTLEMENT.addColumn(new Column("id","结算ID","NUMBER(20)","bigint(20)",false,null));
        SETTLEMENT.addColumn(new Column("account_prisons","监所账号","NUMBER(20)","bigint(20)",false,null));
        SETTLEMENT.addColumn(new Column("account_supplier","供应商账号","NUMBER(20)","bigint(20)",false,null));
        SETTLEMENT.addColumn(new Column("total_settlement","总结算价","NUMBER(10)","int(10)",false,null));
        SETTLEMENT.addColumn(new Column("status","结算状态","NUMBER(10)","int(1)",false,null));
        SETTLEMENT.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        SETTLEMENT.addColumn(new Column("update_time","修改时间","TIMESTAMP","datetime",false,null));
        SETTLEMENT.addColumn(new Column("create_user","创建人","NUMBER(20)","bigint(20)",false,null));

        // 系统参数
        SYSTEM_PARAM.addColumn(new Column("id","编号","NUMBER(20)","bigint(20) unsigned",false,null));
        SYSTEM_PARAM.addColumn(new Column("param_name","参数名","VARCHAR2(60)","varchar(60)",false,null));
        SYSTEM_PARAM.addColumn(new Column("param_value","参数值","VARCHAR2(255)","varchar(255)",false,null));
        SYSTEM_PARAM.addColumn(new Column("param_desc","描述","VARCHAR2(255)","varchar(255)",true,null));
        SYSTEM_PARAM.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        SYSTEM_PARAM.addColumn(new Column("create_user","创建人","NUMBER(20)","bigint(20) unsigned",false,null));
        SYSTEM_PARAM.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        SYSTEM_PARAM.addColumn(new Column("update_user","更新人","NUMBER(20)","bigint(20) unsigned",false,null));

        // 用户
        USER_MEMBER.addColumn(new Column("user_id","用户编号","NUMBER(20)","bigint(20) unsigned",false,null));
        USER_MEMBER.addColumn(new Column("username","用户名","VARCHAR2(20)","varchar(20)",false,null));
        USER_MEMBER.addColumn(new Column("salt","盐值","CHAR(6)","char(6)",false,null));
        USER_MEMBER.addColumn(new Column("password","密码","CHAR(32)","char(32)",false,null));
        USER_MEMBER.addColumn(new Column("user_status","用户状态","NUMBER(4)","tinyint(4)",false,null));
        USER_MEMBER.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        USER_MEMBER.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        USER_MEMBER.addColumn(new Column("org_id","所属组织","NUMBER(20)","bigint(20)",true,null));
        USER_MEMBER.addColumn(new Column("role_id","所属角色","NUMBER(20)","bigint(20)",true,null));
        USER_MEMBER.addColumn(new Column("user_type","用户类型","NUMBER(10)","int(1)",true,null));
        USER_MEMBER.addColumn(new Column("real_name","真实姓名","VARCHAR2(20)","varchar(20)",true,null));

        // 账户
        ACCOUNT.addColumn(new Column("account_id","账户ID","NUMBER","bigint",false,null));
        ACCOUNT.addColumn(new Column("org_id","组织ID","NUMBER","bigint",false,null));
        ACCOUNT.addColumn(new Column("org_name","组织名称","VARCHAR2(20)","varchar(20)",false,null));
        ACCOUNT.addColumn(new Column("status","账户状态","NUMBER","bigint",false,null));
        ACCOUNT.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        ACCOUNT.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        ACCOUNT.addColumn(new Column("money","账户余额","NUMBER","bigint",false,null));

        // 商品历史明细
        GOODS_HISTORY_DETAIL.addColumn(new Column("org_id","组织ID","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("user_id","创建人ID","NUMBER","bigint",true,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_id","上架商品ID","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_name","商品名称","VARCHAR2(100)","varchar(100)",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_type","商品类型","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_bar_code","商品条形码","VARCHAR2(20)","varchar(20)",true,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_market_price","商品市场价","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_sell_price","商品销售价","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_settlement_price","商品结算价","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_spec","商品规格","VARCHAR2(60)","varchar(60)",true,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_unit","商品单位","VARCHAR2(60)","varchar(60)",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_img","商品图片","VARCHAR2(255)","varchar(255)",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("goods_status","商品状态","NUMBER","bigint",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        GOODS_HISTORY_DETAIL.addColumn(new Column("id","商品编号","NUMBER","bigint",false,null));

        // 犯人订单
        ORDER_PRISONER.addColumn(new Column("status","点单状态","NUMBER","bigint",false,null));
        ORDER_PRISONER.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        ORDER_PRISONER.addColumn(new Column("create_type","创建类型","NUMBER","bigint",false,null));
        ORDER_PRISONER.addColumn(new Column("prisoner_info","犯人账号ID","NUMBER","bigint",false,null));
        ORDER_PRISONER.addColumn(new Column("order_prisoner_id","犯人点单ID","NUMBER","bigint",false,null));
        ORDER_PRISONER.addColumn(new Column("total_invoice","已发货数量","NUMBER","bigint",true,null));
        ORDER_PRISONER.addColumn(new Column("total_count","商品总数量","NUMBER","bigint",false,null));
        ORDER_PRISONER.addColumn(new Column("total_money","商品总金额","NUMBER","bigint",false,null));
        ORDER_PRISONER.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        ORDER_PRISONER.addColumn(new Column("prisoner_name","犯人姓名","VARCHAR2(20)","varchar(20)",false,null));
        ORDER_PRISONER.addColumn(new Column("room","监仓号","VARCHAR2(20)","varchar(20)",false,null));
        ORDER_PRISONER.addColumn(new Column("create_user","创建人","VARCHAR2(20)","varchar(20)",true,null));

        // 犯人订单明细
        ORDER_PRISONER_DETAIL.addColumn(new Column("invoice_count","发货数量","NUMBER","bigint",true,null));
        ORDER_PRISONER_DETAIL.addColumn(new Column("goods_history_id","历史商品ID","NUMBER","bigint",true,null));
        ORDER_PRISONER_DETAIL.addColumn(new Column("goods_id","商品ID","NUMBER","bigint",false,null));
        ORDER_PRISONER_DETAIL.addColumn(new Column("order_prisoner_id","犯人订单ID","NUMBER","bigint",false,null));
        ORDER_PRISONER_DETAIL.addColumn(new Column("order_prisoner_detail_id","犯人订单详情ID","NUMBER","bigint",false,null));
        ORDER_PRISONER_DETAIL.addColumn(new Column("goods_count","商品数量","NUMBER","bigint",false,null));

        // 犯人账户
        PRISONER_ACCOUNT.addColumn(new Column("available_amount","可用余额","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("consumption_threshold","消费阈值","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("status","账户状态","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("freezing_amount","冻结资金","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("bank_card","银行卡号","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("update_time","修改时间","TIMESTAMP","datetime",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("balance","账户余额","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("prisoner_id","账户ID","NUMBER","bigint",false,null));
        PRISONER_ACCOUNT.addColumn(new Column("bank_name","银行名称","VARCHAR2(50)","varchar(50)",false,null));

        // 犯人信息
        PRISONER_INFO.addColumn(new Column("id_card","身份证号","VARCHAR2(18)","varchar(18)",false,null));
        PRISONER_INFO.addColumn(new Column("img","犯人头像","VARCHAR2(500)","varchar(500)",true,null));
        PRISONER_INFO.addColumn(new Column("org_id","所属监所","NUMBER","bigint",true,null));
        PRISONER_INFO.addColumn(new Column("crime_info","犯罪信息","VARCHAR2(500)","varchar(500)",true,null));
        PRISONER_INFO.addColumn(new Column("sex","性别","NUMBER","bigint",true,null));
        PRISONER_INFO.addColumn(new Column("prisoner_id","犯人ID","NUMBER","bigint",false,null));
        PRISONER_INFO.addColumn(new Column("status","犯人状态(1,正常。2,冻结。9,离监)","NUMBER","bigint",false,null));
        PRISONER_INFO.addColumn(new Column("area","监仓号","VARCHAR2(20)","varchar(20)",false,null));
        PRISONER_INFO.addColumn(new Column("room","监区号","VARCHAR2(20)","varchar(20)",false,null));
        PRISONER_INFO.addColumn(new Column("name","犯人姓名","VARCHAR2(20)","varchar(20)",false,null));

        // 犯人结算
        PRISONER_SETTLEMENT.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("status","结算状态","NUMBER","bigint",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("settlement_money","结算金额","NUMBER","bigint",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("prisons_account","监所账户","NUMBER","bigint",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("prisoner_account","犯人账户","NUMBER","bigint",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("settlement_id","犯人结算ID","NUMBER","bigint",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("update_time","修改时间","TIMESTAMP","datetime",false,null));
        PRISONER_SETTLEMENT.addColumn(new Column("order_prisoner_id","点单ID","NUMBER","bigint",false,null));

        // 犯人与供应商订单关联
        RELATION_SUPPLIER_PRISONER.addColumn(new Column("order_supplier_id","供应商订单ID","NUMBER","bigint",false,null));
        RELATION_SUPPLIER_PRISONER.addColumn(new Column("order_prisoner_id","犯人点单ID","NUMBER","bigint",false,null));

        // 发放单
        RELEASE_SLIP.addColumn(new Column("id","发放清单编号","NUMBER","bigint",false,null));
        RELEASE_SLIP.addColumn(new Column("account_supplier","供应商编号","NUMBER","bigint",false,null));
        RELEASE_SLIP.addColumn(new Column("account_prisons","监所编号","NUMBER","bigint",false,null));
        RELEASE_SLIP.addColumn(new Column("invoice_id","发货单编号","NUMBER","bigint",false,null));
        RELEASE_SLIP.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        RELEASE_SLIP.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        RELEASE_SLIP.addColumn(new Column("status","状态","NUMBER","bigint",false,null));
        RELEASE_SLIP.addColumn(new Column("create_user","创建人","NUMBER","bigint",true,null));

        // 发放单明细
        RELEASE_SLIP_DETAIL.addColumn(new Column("prisoner_id","犯人账号","NUMBER","bigint",true,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("account_supplier","供应商账号","NUMBER","bigint",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("account_prisons","监所账号","NUMBER","bigint",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("order_prisoner_detail_id","点单详情ID","NUMBER","bigint",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("room","监区","VARCHAR2(50)","varchar(50)",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("count","商品数量","NUMBER","bigint",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("id","ID","NUMBER","bigint",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("goods_history_id","历史商品ID","NUMBER","bigint",true,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("publish_detail_id","上架商品ID","NUMBER","bigint",false,null));
        RELEASE_SLIP_DETAIL.addColumn(new Column("release_slip_id","发放单ID","NUMBER","bigint",false,null));

        // 用户明细
        USER_DETAIL.addColumn(new Column("user_id","用户编号","NUMBER","bigint",false,null));
        USER_DETAIL.addColumn(new Column("update_time","更新时间","TIMESTAMP","datetime",false,null));
        USER_DETAIL.addColumn(new Column("create_time","创建时间","TIMESTAMP","datetime",false,null));
        USER_DETAIL.addColumn(new Column("email","邮箱","VARCHAR2(100)","varchar(100)",true,null));
        USER_DETAIL.addColumn(new Column("age","年龄","NUMBER","bigint",true,null));
        USER_DETAIL.addColumn(new Column("mobile_phone","手机号","VARCHAR2(20)","varchar(20)",true,null));
        USER_DETAIL.addColumn(new Column("real_name","真实姓名","VARCHAR2(20)","varchar(20)",true,null));
        USER_DETAIL.addColumn(new Column("sex","性别","NUMBER","bigint",true,null));
        USER_DETAIL.addColumn(new Column("address","地址","VARCHAR2(200)","varchar(200)",true,null));
    }

}
